package com.candy.service.impl;

import com.candy.dao.IAccountDao;
import com.candy.dao.impl.AccountDaoImpl;
import com.candy.service.IAccountService;

import java.util.Date;

public class AccountSerivceImpl implements IAccountService {
    private String name;
    private Integer age;
    private Date birthday;
    private IAccountDao accountDao=new AccountDaoImpl();

    public AccountSerivceImpl() {
    }

    public AccountSerivceImpl(String name, Integer age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public AccountSerivceImpl(IAccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public void saveAccount() {
        System.out.println("name:"+name+"；age："+age+";birthday:"+birthday);

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void  initMethod(){
        System.out.println("对象初始化调用");
    }

    public void endMethod(){
        System.out.println("对象销毁时");
    }

    @Override
    public String toString() {
        return "AccountSerivceImpl{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +
                '}';
    }
}
